import React, { Component } from 'react';
import "../styles/QuanGong.scss"
import * as service from "../api/index"
import { NavBar } from 'antd-mobile'

class QuanGong extends Component {
    state = {
        one: []
    }
    async componentDidMount() {
        var res = await service.gong_xia()
        console.log(res.data.list);
        this.setState({ one: res.data.list },)
    }
    render() {
        return (
            <div className="quanbugonglue">
                <div className="top">
                    <NavBar onBack={() => { this.props.history.go(-1) }}><h3>全部攻略</h3></NavBar>
                </div>
                <div className="xia">
                    {
                        this.state.one.map((item, index) => {
                            return (
                                <div className="xia_box" key={index}>
                                    <div className="zuo">
                                        <img src={item.pic} alt="" />
                                    </div>
                                    <div className="you">
                                        <h4>{item.dizhi} | {item.title}</h4>
                                        <p>{item.jieshao}</p>
                                        <p>{item.name}</p>
                                    </div>
                                </div>
                            )
                        })
                    }
                </div>
            </div>
        );
    }
}

export default QuanGong;